home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 424_02 / ED-157 / ctyp_dec.h < prev    next >
C/C++ Source or Header  |  1993-09-10  |  1KB  |  30 lines

  1. /* do not change the 'unsigned char' to 'Uchar'. regex uses this, and it doesn't include opsys.h */
  2. #define    _U    01
  3. #define    _L    02
  4. #define    _N    04
  5. #define    _S    010
  6. #define _P    020
  7. #define _C    040
  8. #define _X    0100
  9. #define    _B    0200
  10. extern unsigned char _my_ctype_[];
  11. extern unsigned char _my_tolower_[];
  12. extern unsigned char _my_toupper_[];
  13. extern unsigned char _my_tooppos_[];
  14. #define    isalpha(c)    ((_my_ctype_[(unsigned char)(c)])&(_U|_L))
  15. #define    isupper(c)    ((_my_ctype_[(unsigned char)(c)])&_U)
  16. #define    islower(c)    ((_my_ctype_[(unsigned char)(c)])&_L)
  17. #define    isdigit(c)    ((_my_ctype_[(unsigned char)(c)])&_N)
  18. #define    isxdigit(c)    ((_my_ctype_[(unsigned char)(c)])&_X)
  19. #define    isspace(c)    ((_my_ctype_[(unsigned char)(c)])&_S)
  20. #define ispunct(c)    ((_my_ctype_[(unsigned char)(c)])&_P)
  21. #define isalnum(c)    ((_my_ctype_[(unsigned char)(c)])&(_U|_L|_N))
  22. #define isprint(c)    ((_my_ctype_[(unsigned char)(c)])&(_P|_U|_L|_N|_B))
  23. #define    isgraph(c)    ((_my_ctype_[(unsigned char)(c)])&(_P|_U|_L|_N))
  24. #define iscntrl(c)    ((_my_ctype_[(unsigned char)(c)])&_C)
  25. #define isascii(c)    ((unsigned char)(c)<=0177)
  26. #define toascii(c)    ((c)&0177)
  27. #define tolower(c)  (_my_tolower_[(unsigned char)(c)])
  28. #define toupper(c)  (_my_toupper_[(unsigned char)(c)])
  29. #define tooppos(c)  (_my_tooppos_[(unsigned char)(c)])
  30.